<?php echo use_helper('jQuery') ?>
<?php if($element->getSectionId()):?>
    <?php slot('tree') ?>
        <?php include_partial('portal/gardener', array('portal' => $element->getSection()->getPortal()))?>
    <?php end_slot() ?>
<?php elseif($element->getHeaderId()):?>
    <?php slot('tree') ?>
        <?php include_partial('portal/gardener', array('portal' => $element->getHeader()->getPortal()))?>
    <?php end_slot() ?>
<?php elseif($element->getFooterId()):?>
    <?php slot('tree') ?>
        <?php include_partial('portal/gardener', array('portal' => $element->getFooter()->getPortal()))?>
    <?php end_slot() ?>
<?php endif; ?>
<?php slot('main') ?>
    <?php include_partial('element/show'.$element->getType()->getType(), array('element' => $element))?>
<?php end_slot() ?>

<?php echo jq_javascript_tag(
        'clearTree();showLoaderTree();'
        .
        jq_update_element_function('tree_content', array('content' => get_slot('tree')))
        .
        'createTree();activateTreeMenu();'
        .
        jq_update_element_function('main', array('content' => get_slot('main')))
)?>